package cs275.ants.graph.antgraph;

import java.util.ArrayList;

import junit.framework.TestCase;

import org.easymock.EasyMock;

import cs275.ants.agent.Ant;

import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;

public class AntGraphVertexTest extends TestCase {
	private AntGraphVertex vertex;
	private Ant ant1;
	private Ant ant2;

	@Override
	protected void setUp() throws Exception {
		vertex = new AntGraphVertex(new ArrayList<Ant>(), 0, 0);
		ant1 = EasyMock.createNiceMock(Ant.class);
		ant2 = EasyMock.createNiceMock(Ant.class);
	}

	public void testAddAnt() {
		replay(ant1, ant2);
		vertex.addAnt(ant1);
		
		assertTrue(vertex.getAnts().contains(ant1));
		assertFalse(vertex.getAnts().contains(ant2));
		
		vertex.addAnt(ant2);
		assertTrue(vertex.getAnts().contains(ant1));
		assertTrue(vertex.getAnts().contains(ant2));
		verify(ant1, ant2);
	}
}
